#include <TLorentzVector.h>
#include "CpLog.h"
#include "CpParticle.h"

ClassImp(CpParticle);

//________________________________________________________________________________________________________________
CpParticle::CpParticle() : TNamed(),
fType(kMagnetic),
fID(0),
fNumberOfTracks(0),
fTracks("CpTrack", 0)
{

}

//________________________________________________________________________________________________________________
CpParticle::CpParticle(const char* name, const char* title): TNamed(name, title),
fType(kMagnetic),
fID(0),
fNumberOfTracks(0),
fTracks("CpTrack", 0)
{

}

void CpParticle::Clear(const Option_t*/*option*/)
{
   fNumberOfTracks = 0;
   fTracks.Delete();
}


void CpParticle::Print(Option_t* /*option*/) const
{

   CpInfo(Form("Number of Tracks = %lld", fNumberOfTracks));

   CpTrack*track;
   for (Long64_t iTrack = 0; iTrack < fNumberOfTracks; iTrack++) {
      track = (CpTrack*) fTracks.At(iTrack);
      track->Print();
   }

}

CpTrack* CpParticle::AddTrack(const Int_t& id)
{
   return new(fTracks[fNumberOfTracks++]) CpTrack(id);

}

